package com.jd.controller;

import com.jd.service.ChainServiceTest;
import jdk.nashorn.internal.objects.annotations.Setter;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangshuping
 * @version 1.0
 * @date 2021/12/17 17:10
 */
@RestController
@RequestMapping("flow-limit")
public class FlowLimitController {

    private final ChainServiceTest chainServiceTest;

    public FlowLimitController(ChainServiceTest chainServiceTest) {
        this.chainServiceTest = chainServiceTest;
    }


    @GetMapping("testA")
    public String testA() {
        System.out.println("访问testA");
        return chainServiceTest.chainTest();
    }

    @GetMapping("testB")
    public String testB() {
        return chainServiceTest.chainTest();
    }

    @GetMapping("warmUp")
    public String warmUp() {
        return "warmUp";
    }

    @GetMapping("rateLimiter")
    public String rateLimiter() {
        return "rateLimiter";
    }
}
